/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vadung.contragame2d;

import javax.microedition.lcdui.Display;
import javax.microedition.midlet.*;

/**
 * @author dung.voanh
 */
public class Midlet extends MIDlet {

    public static MIDlet s_midlet;
    public static GameContraCanvas s_canGame;
    
    public Midlet() {
        s_midlet = this;
    }
    
    public void startApp() {
        s_canGame = null;
        s_canGame = new GameContraCanvas();
        Display.getDisplay(this).setCurrent(s_canGame);
        s_canGame.Start();
    }
    
    public void pauseApp() {
//        try {
//            s_canGame.Exit();
//        } catch (Exception e) {
//        }
    }

    protected void destroyApp(boolean unconditional) throws MIDletStateChangeException {
        //destroyApp(true);        
        try {
            s_canGame.Exit();
        } catch (Exception e) {
        }
    }
    
    
}
